package com.ctgu.service;

import com.ctgu.dao.UserDao;
import com.ctgu.entity.Record;
import com.ctgu.entity.User;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public User logincheck(User user){
        return userDao.logincheck(user);
    }

    @Override
    public void register(User user){
        userDao.register(user);
    }
    @Override
    public User findUserInfoByName(String username){ return userDao.findUserInfoByName(username); }
    @Override
    public void resetpassword(User user){ userDao.resetpassword(user);}

    @Override
    public PageInfo<Record> getRecord(Record record,Integer pageNum,Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Record>list=userDao.getRecord(record);
        PageInfo<Record>page=new PageInfo<>(list);
        return page;
    }

}
